import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '地址',
    align: 'center',
    dataIndex: 'location',
  },
  {
    title: '详细地址',
    align: 'center',
    dataIndex: 'address',
  },
  // {
  //   title: '经度',
  //   align: "center",
  //   dataIndex: 'longitude'
  // },
  // {
  //   title: '纬度',
  //   align: "center",
  //   dataIndex: 'latitude'
  // },
  {
    title: '预约车位',
    align: 'center',
    dataIndex: 'carportNumber',
  },
  {
    title: '预约时间',
    align: 'center',
    dataIndex: 'subscribeDate',
  },
  {
    title: '预约到期时间',
    align: 'center',
    dataIndex: 'subscribeEndDate',
  },
  {
    title: '验证码',
    align: 'center',
    dataIndex: 'verificationCode',
  },
  {
    title: '车牌号',
    align: 'center',
    dataIndex: 'carNumber',
  },
  {
    title: '预约状态',
    align: 'center',
    dataIndex: 'status_dictText',
  },
  {
    title: '车辆状态',
    align: 'center',
    dataIndex: 'carStatus_dictText',
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '创建人',
    field: 'createBy',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '车牌号',
    field: 'carNumber',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: '预约状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'subscribe_status',
    },
    //colProps: {span: 6},
  },
  {
    label: '车辆状态',
    field: 'carStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'get_out_status',
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '地址',
    field: 'location',
    component: 'Input',
  },
  {
    label: '详细地址',
    field: 'address',
    component: 'InputTextArea',
  },
  {
    label: '经度',
    field: 'longitude',
    component: 'Input',
  },
  {
    label: '纬度',
    field: 'latitude',
    component: 'Input',
  },
  {
    label: '预约车位',
    field: 'carportNumber',
    component: 'Input',
  },
  {
    label: '预约时间',
    field: 'subscribeDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
    },
  },
  {
    label: '验证码',
    field: 'verificationCode',
    component: 'Input',
  },
  {
    label: '车牌号',
    field: 'carNumber',
    component: 'Input',
  },
  {
    label: '预约状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'subscribe_status',
    },
  },
  {
    label: '车辆状态',
    field: 'carStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'get_out_status',
    },
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
